<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function prime(n) {
				//if (n==1||n==3) {alert(n+"you are wrong!")}
				if (n == 0 || n == 1) {
					alert(n + "既不是素数，也不是合数");
					return;
				} // else{
				if (n == 2) {
					alert(n + "是素数");
					return;
				} // else{
				for (i = 2; i < n; i++) {
					if (n % i == 0) {
						alert(n + "不是素数");
						return;
					} else {
						alert(n + "是素数");
						return;
					}
				} 
			}
			var num = prompt("请输入一个数");
			prime(num);
		</script>

	</head>
	<body>
	</body>
</html>
